<?php
/**
 * 汇友科技
 * @copyright (c) 2017 http://www.huiyou365.net All rights reserved.
 * @author: Creatint <creatint@163.com>
 */

namespace Admin\Model;

use Common\Model\Model;
use Closure;
use Common\Logic\BaseLogic;

class ModelModel extends Model {
    // 基础文档模型名称
    public $base = null;


    public function logic($model_id){
        // 由模型id获得模型数据
        $model = $this->get(['id'=>$model_id]);

        // 获得完整表名
        if ( $model['extend'] ) {
            $name = "{$model['extend']}_{$model['name']}";
            $this->base = $model['extend'];
        } else {
            $name = $model['name'];
        }
        // 获得逻辑模型实例
        $Logic = new BaseLogic($name, $this);


        return $Logic;
    }
}